package com.avicsafety.ezsystem;

import android.app.Application;

import com.androidnetworking.AndroidNetworking;
import com.avicsafety.ezsystem.local_stoage.LocalStorage;
import com.tencent.bugly.crashreport.CrashReport;

import java.util.LinkedHashMap;
import java.util.Map;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        LocalStorage.init(getApplicationContext());
        AndroidNetworking.initialize(getApplicationContext());

        //CrashReport.initCrashReport(getApplicationContext(), "b1ad22d0d3", true);
//
//        CrashReport.UserStrategy strategy = new CrashReport.UserStrategy(getApplicationContext());
//        strategy.setCrashHandleCallback(new CrashReport.CrashHandleCallback() {
//            public Map<String, String> onCrashHandleStart(int crashType, String errorType,
//                                                          String errorMessage, String errorStack) {
//                LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
//                map.put("Key", "Value");
//                return map;
//            }
//
//            @Override
//            public byte[] onCrashHandleStart2GetExtraDatas(int crashType, String errorType,
//                                                           String errorMessage, String errorStack) {
//                try {
//                    return "Extra data.".getBytes("UTF-8");
//                } catch (Exception e) {
//                    return null;
//                }
//            }
//
//        });
//        CrashReport.initCrashReport(getApplicationContext(), "b1ad22d0d3", true, strategy);
    }
}
